<template>
    <h3>ComponentA</h3>
    <p>父组件：{{ message }}</p>
    <ComponentB title="标题" :onEvent="dataFn" />
</template>

<script>
import ComponentB from './ComponentB.vue';
export default {
    data() {
        return {
            message: ""
        }
    },
    components: {
        ComponentB
    },
    methods: {
        dataFn(data) {
            console.log(data);
            this.message = data
        }
    }
}
</script>
